package cn.iocoder.yudao.module.xiaoBizHandler.dal.mysql.tbGenGoodsRegister;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.xiaoBizHandler.dal.dataobject.tbGenGoodsRegister.XTbGenGoodsRegisterDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.xiaoBizHandler.controller.admin.tbGenGoodsRegister.vo.*;
/**
 * 物品登记 Mapper
 *
 * @author xiaosy
 */
@Mapper
public interface XTbGenGoodsRegisterMapper extends BaseMapperX<XTbGenGoodsRegisterDO> {

    default PageResult<XTbGenGoodsRegisterDO> selectPage(XTbGenGoodsRegisterPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<XTbGenGoodsRegisterDO>()
			                .likeIfPresent(XTbGenGoodsRegisterDO::getName, reqVO.getName())
                .eqIfPresent(XTbGenGoodsRegisterDO::getLocation, reqVO.getLocation())
                .eqIfPresent(XTbGenGoodsRegisterDO::getRemarkContent, reqVO.getRemarkContent())
                .eqIfPresent(XTbGenGoodsRegisterDO::getCategory, reqVO.getCategory())
                .eqIfPresent(XTbGenGoodsRegisterDO::getLabel, reqVO.getLabel())

                .orderByDesc(XTbGenGoodsRegisterDO::getId));

    }

    default List<XTbGenGoodsRegisterDO> selectList(XTbGenGoodsRegisterExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<XTbGenGoodsRegisterDO>()
			                .likeIfPresent(XTbGenGoodsRegisterDO::getName, reqVO.getName())
                .eqIfPresent(XTbGenGoodsRegisterDO::getLocation, reqVO.getLocation())
                .eqIfPresent(XTbGenGoodsRegisterDO::getRemarkContent, reqVO.getRemarkContent())
                .eqIfPresent(XTbGenGoodsRegisterDO::getCategory, reqVO.getCategory())
                .eqIfPresent(XTbGenGoodsRegisterDO::getLabel, reqVO.getLabel())

                .orderByDesc(XTbGenGoodsRegisterDO::getId));

    }

}

